package com.nts.visionworks.core.security.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * ManagementDepartment generated by hbm2java
 */
@Entity
@Table(name = "management_department", catalog = "visionworks")
public class ManagementDepartment implements java.io.Serializable
{

	private Long departmentId;
	private long parentId;
	private String departmentName;
	private Date createdDateTime;
	private long creatorId;
	private Date updatedDateTime;
	private Set<ManagementMember> managementMembers = new HashSet<ManagementMember>(
			0);

	public ManagementDepartment()
	{
	}

	public ManagementDepartment(long parentId, String departmentName,
			Date createdDateTime, long creatorId)
	{
		this.parentId = parentId;
		this.departmentName = departmentName;
		this.createdDateTime = createdDateTime;
		this.creatorId = creatorId;
	}

	public ManagementDepartment(long parentId, String departmentName,
			Date createdDateTime, long creatorId, Date updatedDateTime,
			Set<ManagementMember> managementMembers)
	{
		this.parentId = parentId;
		this.departmentName = departmentName;
		this.createdDateTime = createdDateTime;
		this.creatorId = creatorId;
		this.updatedDateTime = updatedDateTime;
		this.managementMembers = managementMembers;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "DepartmentId", unique = true, nullable = false)
	public Long getDepartmentId()
	{
		return this.departmentId;
	}

	public void setDepartmentId(Long departmentId)
	{
		this.departmentId = departmentId;
	}

	@Column(name = "ParentId", nullable = false)
	public long getParentId()
	{
		return this.parentId;
	}

	public void setParentId(long parentId)
	{
		this.parentId = parentId;
	}

	@NotNull(message = "validation.managementDepartment.departmentName.notNull")
	@Size(message = "validation.managementDepartment.departmentName.length", max = 100, min = 1)
	@Column(name = "DepartmentName", nullable = false, length = 100)
	public String getDepartmentName()
	{
		return this.departmentName;
	}

	public void setDepartmentName(String departmentName)
	{
		this.departmentName = departmentName;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CreatedDateTime", nullable = false, length = 19)
	public Date getCreatedDateTime()
	{
		return this.createdDateTime;
	}

	public void setCreatedDateTime(Date createdDateTime)
	{
		this.createdDateTime = createdDateTime;
	}

	@Column(name = "CreatorId", nullable = false)
	public long getCreatorId()
	{
		return this.creatorId;
	}

	public void setCreatorId(long creatorId)
	{
		this.creatorId = creatorId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UpdatedDateTime", length = 19)
	public Date getUpdatedDateTime()
	{
		return this.updatedDateTime;
	}

	public void setUpdatedDateTime(Date updatedDateTime)
	{
		this.updatedDateTime = updatedDateTime;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "management_department_member", catalog = "visionworks", joinColumns =
	{ @JoinColumn(name = "DepartmentId", nullable = false, updatable = false) }, inverseJoinColumns =
	{ @JoinColumn(name = "MemberId", nullable = false, updatable = false) })
	public Set<ManagementMember> getManagementMembers()
	{
		return this.managementMembers;
	}

	public void setManagementMembers(Set<ManagementMember> managementMembers)
	{
		this.managementMembers = managementMembers;
	}

}
